<?php

namespace App\Library\Traits\Orm;

use App\Models\ShopProductModel;
use Illuminate\Database\Eloquent\Relations\HasOne;

trait HelpOrmTrait
{
    public function product(): HasOne
    {
        return $this->hasOne(ShopProductModel::class, 'product_id', 'product_id');
    }

    public function spec(): HasOne
    {
        return $this->hasOne(ShopProductModel::class, 'spec_id', 'product_id');
    }
}
